package com.ahp.util;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import freemarker.template.TemplateException;

public class FreemarkerTest {
	public void createHTML() {
		StaticFreemarker sf = new StaticFreemarker();
		Map map = new HashMap();

		String[] infos = {"information1","information2","information3"};
		
		map.put("list", infos);

		String url = "index";
		String htmlfile = url+"/test.html";

		try {
			sf.init("test.ftl", htmlfile, map, url);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TemplateException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	
	public static void main(String[] args) {
		new FreemarkerTest().createHTML();
	}
}
